<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}VisoonSpace - 个人技术博客{% endblock %}</title>
    
    <!-- Bootstrap CSS -->
    <link href="https://cdn.bootcdn.net/ajax/libs/bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <!-- Google Fonts -->
    <link href="https://fonts.loli.net/css2?family=JetBrains+Mono:wght@300;400;500;700&family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    
    {% load static %}
    <link rel="stylesheet" href="{% static 'css/style.css' %}">
    
    {% block extra_css %}{% endblock %}
</head>
<body>
    <!-- Navigation -->
    <nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top tech-nav">
        <div class="container">
            <a class="navbar-brand tech-brand" href="{% url 'home' %}">
                <i class="fas fa-code"></i>
                <span class="brand-text">VisoonSpace</span>
            </a>
            
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav ms-auto">
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'home' %}">
                            <i class="fas fa-home"></i> 首页
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'blog:article_list' %}">
                            <i class="fas fa-blog"></i> 文章
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'tools:tool_list' %}">
                            <i class="fas fa-tools"></i> 工具
                        </a>
                    </li>
                    {% if user.is_authenticated %}
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'blog:article_create' %}">
                            <i class="fas fa-plus"></i> 写文章
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'tools:tool_create' %}">
                            <i class="fas fa-plus-circle"></i> 添加工具
                        </a>
                    </li>
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown">
                            <i class="fas fa-user"></i> {{ user.username }}
                        </a>
                        <ul class="dropdown-menu">
                            <li><a class="dropdown-item" href="/admin/"><i class="fas fa-cog"></i> 管理后台</a></li>
                            <li><hr class="dropdown-divider"></li>
                            <li><a class="dropdown-item" href="{% url 'logout' %}"><i class="fas fa-sign-out-alt"></i> 退出登录</a></li>
                        </ul>
                    </li>
                    {% else %}
                    <li class="nav-item">
                        <a class="nav-link login-trigger" href="#" data-login-trigger="true">
                            <i class="fas fa-sign-in-alt"></i> 登录
                        </a>
                    </li>
                    {% endif %}
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'home' %}#contact">
                            <i class="fas fa-envelope"></i> 联系
                        </a>
                    </li>
                </ul>
            </div>
        </div>
    </nav>

    <!-- Main Content -->
    <main class="main-content">
        {% block content %}{% endblock %}
    </main>

    <!-- Footer -->
    <footer class="tech-footer bg-dark text-light py-4 mt-5">
        <div class="container">
            <div class="row">
                <div class="col-md-6">
                    <h5><i class="fas fa-code"></i> VisoonSpace</h5>
                    <p class="mb-0">分享技术，传递价值</p>
                </div>
                <div class="col-md-6 text-md-end">
                    <div class="social-links">
                        <a href="#" class="text-light me-3" title="GitHub"><i class="fab fa-github"></i></a>
                        <a href="mailto:your@email.com" class="text-light me-3" title="邮箱"><i class="fas fa-envelope"></i></a>
                        <a href="#" class="text-light me-3" title="微信"><i class="fab fa-weixin"></i></a>
                        <a href="#" class="text-light" title="QQ"><i class="fab fa-qq"></i></a>
                    </div>
                    <p class="mb-0 mt-2">&copy; 2024 VisoonSpace. All rights reserved.</p>
                </div>
            </div>
        </div>
    </footer>

    <!-- Bootstrap JS -->
    <script src="https://cdn.bootcdn.net/ajax/libs/bootstrap/5.3.0/js/bootstrap.bundle.min.js"></script>
    {% load static %}
    <script src="{% static 'js/main.js' %}"></script>
    
    <!-- 登录弹窗 -->
    {% include 'login_modal.html' %}
    
    {% block extra_js %}{% endblock %}
</body>
</html>